package com.res.share.common.utils;


import org.hashids.Hashids;

public class UserIdConvertor {

    private static Hashids hashids = new Hashids("ResShare@2021#UserId4UUID", 8);

    public UserIdConvertor() {
    }

    public static final Long convert(String uuid) {
        if (uuid == null) {
            return null;
        } else {
            try {
                return hashids.decode(uuid)[0];
            } catch (IllegalArgumentException var2) {
            } catch (Exception var3) {
            }

            return null;
        }
    }

    public static final String convert(long userId) {
        return hashids.encode(new long[]{userId});
    }
}

